﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.ServiceModel;
using System.Runtime.Serialization;
using HF.Framework.SqlDataContract;

namespace HF.WCF.DBService
{
    [ServiceContract]
    public  interface IDataBaseService
    {
        [OperationContract]
        int ExecuteNonQuery(SqlDataItem sqlDataItem);
        [OperationContract]
        DataSet ExecuteQuery(SqlDataItem sqlDataItem);
        [OperationContract]
        bool ExecuteNonQueryArray(SqlDataItemArray arySqlDataItem);
        [OperationContract]
        string ExecuteScalar(SqlDataItem sqlDataItem);
        [OperationContract]
        bool RecordExists(SqlDataItem sqlDataItem);
        //[OperationContract]
        //string GetSlXml(SqlDataItem sqlDataItem);
        [OperationContract]
        string GetXml(SqlDataItem sqlDataItem);
        #region 访问当前数据库的表和字段
        [OperationContract]
        string GetCurrentDatabaseName();
        [OperationContract]
        DataSet GetDBQuery(string databaseName);
        [OperationContract]
        DataSet GetDTColumnsQuery(string tableName, string databaseName);
        [OperationContract]
        string GetDBDateTime();
        #endregion

        #region 获得一个空结构
        [OperationContract(Name = "GetBlankDataSet0")]
        DataSet GetBlankDataSet(List<string> tableNames, string databaseName);
        [OperationContract(Name = "GetBlankDataSet1")]
        DataSet GetBlankDataSet(List<string> tableNames);
        #endregion

        #region 更新数据集
        [OperationContract(Name = "UpdateDataSetWithTranse0")]
        void UpdateDataSetWithTranse(DataSet dataSet, string databaseName);
        [OperationContract(Name="UpdateDataSetWithTranse1")]
        void UpdateDataSetWithTranse(DataSet dataSet);
        #endregion

 
    }
}
